package t327.pojo.staffView;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.util.Date;


public class StaffManagementView {
  //当前实际时间
  private LocalDate currentDate = LocalDate.now();

  private Long staffId;
  private String staffName;
  private Long staffAge;
  private String staffSex;
  private String staffIdentityCard;
  private Long staffPhone;
  private String staffType;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  private Date staffEntryTime;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  private Date staffResignationTime;
  private String staffStatus;
  private String staffImg;
  private String staffEducationBackground;
  private String staffBankCard;
  private String staffDepartment;
  private String status;
  private String staffPosition;
  //推迟30天的时间
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  private final LocalDate futureDate30 = currentDate.plusDays(30);
  //推迟3天的天数
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  private final LocalDate futureDate3 = currentDate.plusDays(3);

  public String getStaffPosition() {
    return staffPosition;
  }

  public LocalDate getCurrentDate() {
    return currentDate;
  }

  public void setCurrentDate(LocalDate currentDate) {
    this.currentDate = currentDate;
  }

  public LocalDate getFutureDate30() {
    return futureDate30;
  }

  public LocalDate getFutureDate3() {
    return futureDate3;
  }

  public void setStaffPosition(String staffPosition) {
    if("0".equals(staffPosition)){
      this.staffPosition="职员";
    }else if("1".equals(staffPosition)){
      this.staffPosition="组长";
    }else if("2".equals(staffPosition)){
      this.staffPosition="车间主任";
    }else if("3".equals(staffPosition)){
      this.staffPosition="厂长";
    }else {
      this.staffPosition="未知";
    }
  }

  @Override
  public String toString() {
    return "StaffManagementView{" +
            "staffId=" + staffId +
            ", staffName='" + staffName + '\'' +
            ", staffAge=" + staffAge +
            ", staffSex='" + staffSex + '\'' +
            ", staffIdentityCard='" + staffIdentityCard + '\'' +
            ", staffPhone=" + staffPhone +
            ", staffType='" + staffType + '\'' +
            ", staffEntryTime=" + staffEntryTime +
            ", staffResignationTime=" + staffResignationTime +
            ", staffStatus=" + staffStatus +
            ", staffImg='" + staffImg + '\'' +
            ", staffEducationBackground='" + staffEducationBackground + '\'' +
            ", staffSite='" + staffBankCard + '\'' +
            ", staffDepartment='" + staffDepartment + '\'' +
            ", status='" + status + '\'' +
            ", staffPosition='" + staffPosition + '\'' +
            '}';
  }

  public Long getStaffId() {
    return staffId;
  }

  public void setStaffId(Long staffId) {
    this.staffId = staffId;
  }

  public String getStaffName() {
    return staffName;
  }

  public void setStaffName(String staffName) {
    this.staffName = staffName;
  }

  public Long getStaffAge() {
    return staffAge;
  }

  public void setStaffAge(Long staffAge) {
    this.staffAge = staffAge;
  }

  public String getStaffSex() {
    return staffSex;
  }

  public String getStaffIdentityCard() {
    return staffIdentityCard;
  }

  public void setStaffIdentityCard(String staffIdentityCard) {
    this.staffIdentityCard = staffIdentityCard;
  }

  public Long getStaffPhone() {
    return staffPhone;
  }

  public void setStaffPhone(Long staffPhone) {
    this.staffPhone = staffPhone;
  }

  public String getStaffType() {
    return staffType;
  }

  public void setStaffType(String staffType) {
    if ("1".equals(staffType)){
      this.staffType="正式工";
    }else if ("2".equals(staffType)){
      this.staffType="实习工";
    }else {
      this.staffType="未知";
    }
  }

  public Date getStaffEntryTime() {
    return staffEntryTime;
  }

  public void setStaffEntryTime(Date staffEntryTime) {
    this.staffEntryTime = staffEntryTime;
  }

  public Date getStaffResignationTime() {
    return staffResignationTime;
  }

  public void setStaffResignationTime(Date staffResignationTime) {
    this.staffResignationTime = staffResignationTime;
  }

  public String getStaffStatus() {
    return staffStatus;
  }

  public void setStaffStatus(String staffStatus) {
    if ("0".equals(staffStatus)) {
      this.staffStatus="离职";
    } else if ("1".equals(staffStatus)) {
      this.staffStatus="在职";
    }else if ("2".equals(staffStatus)) {
      this.staffStatus="待离职";
    } else {
      this.staffStatus="未知";
    }
  }

  public String getStaffImg() {
    return staffImg;
  }

  public void setStaffImg(String staffImg) {
    this.staffImg = staffImg;
  }

  public String getStaffEducationBackground() {
    return staffEducationBackground;
  }

  public void setStaffEducationBackground(String staffEducationBackground) {
    if ("1".equals(staffEducationBackground)){
      this.staffEducationBackground="小学";
    }else if ("2".equals(staffEducationBackground)){
      this.staffEducationBackground="中学";
    }else if ("3".equals(staffEducationBackground)){
      this.staffEducationBackground="大学";
    }else if ("4".equals(staffEducationBackground)){
      this.staffEducationBackground="研究生 ";
    }else {
      this.staffEducationBackground="未知";
    }
  }

  public String getStaffBankCard() {
    return staffBankCard;
  }

  public void setStaffBankCard(String staffBankCard) {
    this.staffBankCard = staffBankCard;
  }

  public String getStaffSite() {
    return staffBankCard;
  }

  public void setStaffSite(String staffSite) {
    this.staffBankCard = staffSite;
  }

  public String getStaffDepartment() {
    return staffDepartment;
  }

  public void setStaffDepartment(String staffDepartment) {
    this.staffDepartment = staffDepartment;
  }

  public String getStatus() {
    return status;
  }

  public void setStatus(String status) {
    this.status= status;
  }

  public void setStaffSex(String staffSex) {
    if ("1".equals(staffSex)) {
      this.staffSex="男";
    } else if ("0".equals(staffSex)) {
      this.staffSex="女";
    } else {
      this.staffSex="未知";
    }
  }
}
